luci-mod-network: fix SAE/WPA check on network join
authorJo-Philipp Wich <[email protected]>
Sun, 1 Nov 2020 17:20:36 +0000 (18:20 +0100)
committerJo-Philipp Wich <[email protected]>
Sun, 1 Nov 2020 17:24:13 +0000 (18:24 +0100)
commit4e8620443de9f8e87c094f513028e6e005ad1391
tree85cec3a22b06e65763e4dbc285e4b0c36fc32fec
parenta7eaf92454619305435d3abd899c99834d3f19ec
luci-mod-network: fix SAE/WPA check on network join

The method array may be null in case of an open network, also not all
occurrences of `is_sae` and `is_psk` were properly checked.

Resolve the issue by moving the length check to the variable initialization.

Fixes: ba98a2fd0 ("luci-mod-network: fix logic bug in parse enc for network join")
Signed-off-by: Jo-Philipp Wich <[email protected]>
modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js